<template>
	<view class="head0">

		<block v-for="(content, index) in contents" :key="index">
			<view class="head01">
				
				<view class="head1">
					<image src="https://ts1.cn.mm.bing.net/th/id/R-C.8f93ff4fe78647a362a2d7cc0c1cd310?rik=wX451BzAQekR9g&riu=http%3a%2f%2fphoto.16pic.com%2f00%2f59%2f36%2f16pic_5936661_b.jpg&ehk=oUmSla2AW%2byZUJNtogTZXifGzTh3PmmIKSYbpHDiTYg%3d&risl=&pid=ImgRaw&r=0" mode="" @click="buyPreferential(content)"></image>
				</view>
				<view class="head3">
					<view class="text-limited">{{ content.content0 }}</view>
					<view class="head32" @click="buyPreferential(content)">详情></view>
				</view>
			</view>
		</block>

	</view>
</template>

<script>
	export default {
		data() {
			return {

				//内容
				contents: [{
						name: "汽车惠民走进群众生活",
						name2: "郑州一汽大众4儿子店",
						time: "2024.10.28 10:12:22",
						content0: "人生是围城，婚姻是围城，进了去，就被生存的种种烦愁包围。城里的人想逃出来，城外的人想冲进去。",
						money: 199.00,
						oldmoney: 399.00,
						starttime: "2024.10.28",
						endtime: "2024.11.28",
						tel: 19903762008,
						precautions: "无"
					},
					{
						name: "汽车惠民走进群众生活",
						name2: "郑州一汽大众4儿子店2",
						time: "2024.10.28 10:12:22",
						content0: "1人生是围城，婚姻是围城，进了去，就被生存的种种烦愁包围。城里的人想逃出来，城外的人想冲进去。",
						money: 99.00,
						oldmoney: 199.00,
						starttime: "2024.10.28",
						endtime: "2024.11.28",
						tel: 19903762008,
						precautions: "无"
					}
				]
			}
		},
		methods: {
			buyPreferential(content){
				uni.navigateTo({
					url:'/pages/buyPreferential/buyPreferential2?name='+content.name+
					"&name2="+content.name2+
					"&time="+content.time+
					"&content0="+content.content0+
					"&money="+content.money+
					"&oldmoney="+content.oldmoney+
					"&starttime="+content.starttime+
					"&endtime="+content.endtime+
					"&tel="+content.tel+
					"&precautions="+content.precautions
					
				})
			}

		}
	}
</script>

<style>
	/* 单行省略 */
	.text-limited {
	  width: 300rpx; /* 设置文本区域的宽度 */
	  overflow: hidden; /* 隐藏超出部分的文本 */
	  white-space: nowrap; /* 不换行 */
	  text-overflow: ellipsis; /* 超出部分显示省略号 */
	}
	
	.head0 {
		width: 95%;

		margin: auto;

	}

	.head01 {
		margin-top: 30rpx;
		background-color: antiquewhite;
		border: 1px solid #ddd;
		border-radius: 30rpx;
		

	}
	
	.head1{
		margin-top: 40rpx;
		margin-left: 40rpx;
	}

	
	
	.head3{
		margin-top: 20rpx;
		display: flex;
		justify-content: space-between;
		margin-left: 20rpx;
		margin-right: 20rpx;
		margin-bottom: 20rpx;
	}
</style>